#ifndef __GLF_CORE_MEM_H_INCLUDED__
#define __GLF_CORE_MEM_H_INCLUDED__

#include <glf/config.h>
#include <glf/core/primitives.h>

namespace glf {

	void* Memset(void* ptr, int value, size_t num);

	int Memcmp(const void * ptr1, const void* ptr2, size_t num);
	void* Memcpy(void* destination, const void* source, size_t num);

	const void* Memchr(const void* ptr, int value, size_t num);
	void* Memchr(void* ptr, int value, size_t num);

	//custom defs
	void* Memset8(void* ptr, unsigned char value, size_t num);
	void* Memset16(void* ptr, unsigned short value, size_t num);
	void* Memset32(void * ptr, unsigned int value, size_t num);

	template<typename T, size_t N>
	void* MemsetTN(T (&arr)[N], int value) {
		return Memset(arr, value, sizeof(T) * N);
	}

	inline void* ZeroMem(void* p, size_t len) {
		return Memset(p, 0, len);
	}

	template<typename T, size_t N>
	void* ZeroMemTN(T (&arr)[N]) {
		return ZeroMem(arr, N * sizeof(T));
	}


} //namespace glf

#endif
